import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";

/**
 * Col.js
 * @date 2018/10/11
 */
import React from 'react';
import CellControl from "./CellControl";
import { fieldLabelProp } from "../../../config"; // warn use <span>&nbsp;</span> to fill empty text

var Col = /*#__PURE__*/function (_React$Component) {
  _inherits(Col, _React$Component);

  var _super = _createSuper(Col);

  function Col() {
    _classCallCheck(this, Col);

    return _super.apply(this, arguments);
  }

  _createClass(Col, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          wrapperFieldComponent = _this$props.wrapperFieldComponent,
          component = _this$props.component,
          pComponent = _this$props.pComponent,
          onRemoveField = _this$props.onRemoveField,
          currentEditField = _this$props.currentEditField;
      return wrapperFieldComponent( /*#__PURE__*/React.createElement(CellControl, {
        pComponent: pComponent,
        component: component,
        onRemoveField: onRemoveField,
        currentEditField: currentEditField
      }, component[fieldLabelProp] || /*#__PURE__*/React.createElement("span", null, "\xA0")), component);
    }
  }]);

  return Col;
}(React.Component);

export { Col as default };